<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<meta content="always" name="referrer">
		<meta charset="utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<!-- 移动端必须的设置 -->
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!-- 禁用电话号码检测功能，禁止对数字随便可以拨号 -->
		<meta name="format-detection" content="telephone=no">
		<!-- 禁用E-mail检测功能 -->
		<meta name="format-detection" content="email=no">
		<!-- 禁用地址检测功能，禁止跳转到地图 -->
		<meta name="format-detection" content="address=no">
		<!-- 在苹果设备上以全屏方式打开本网页 -->
		<meta name="apple-mobile-web-app-capable" content="yes">
		<!-- 设置在苹果设备上状态的颜色，默认白色，要设置成什么颜色以Web颜色的风格而定 -->
		<meta name="apple-mobile-web-app-status-bar-style" content="white">
		<link rel="stylesheet" href="../css/aui.css" />
		<link rel="stylesheet" href="../css/user_Comment.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
		<script type="text/javascript" src="../js/recycle/startScore.js" ></script>
		<script type="text/javascript" src="../js/layui/layui.js "></script>
		<title>服务评价</title>
	</head>

	<body>
	<%@ include file="../basejsp.jsp"%>
		<div class="">
			<div class="main01 aui-padded-15 aui-margin-b-15">
				<div class="aui-row">
					<div class="aui-col-xs-4 main01-left">
						<img src="../img/7a928df20d7c736840eab682e729fde4@2x.png" id="hearderimg"/>
					</div>
					<div class="aui-col-xs-8 main01-right">
						<div class="Comment-main01-name" id="realname">李四</div>
						<div class="Comment-main01-info">
							<!--<span>服务等级：<span class="info-LV">LV4</span></span>-->
							<span>服务次数：<span class="info-frequency" id="num">52</span>次</span>
						</div>
					</div>
				</div>
			</div>
			<div class="main02 aui-margin-b-15">
				<span class="main-title aui-padded-5">服务评价</span>
				<div class="main-content">
					<div class="aui-row main02-list">
						<div class="aui-col-xs-3 main02-list-left">服务态度：</div>
						<div class="aui-col-xs-7 main02-list-center" id="appraisal1">
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
						</div>
						<div class="aui-col-xs-2 main02-list-right" ><span id="serve">0</span>分</div>
					</div>
					<div class="aui-row main02-list">
						<div class="aui-col-xs-3 main02-list-left">收油速度：</div>
						<div class="aui-col-xs-7 main02-list-center" id="appraisal2">
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
						</div>
						<div class="aui-col-xs-2 main02-list-right" ><span id="speed">0</span>分</div>
					</div>
					<div class="aui-row main02-list">
						<div class="aui-col-xs-3 main02-list-left">收油价格：</div>
						<div class="aui-col-xs-7 main02-list-center" id="appraisal3">
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
						</div>
						<div class="aui-col-xs-2 main02-list-right" ><span id="price">0</span>分</div>
					</div>
				</div>
			</div>
			<div class="main03 aui-margin-b-15">
				<span class="main-title aui-padded-5">服务评价</span>
				<div class="main-content">
					<textarea id="content" onfocus="if(value=='填写您的想法和建议...'){value=''}" onblur="if (value ==''){value='填写您的想法和建议...'}">填写您的想法和建议...</textarea>
				</div>
			</div>
			<div class="submit aui-padded-15">
				<button onclick="submitfunction()">提交评价</button>
			</div>
		</div>
	</body>
	<script>
	<%String phone = (String) request.getParameter("phone");%>
	$(function(){
		/*layui.use('layer', function(){
		})*/
		GetSingleOpenIdForMobile( <%=phone%>);
	})
		scoreFun($("#appraisal1"))
		scoreFun($("#appraisal2"))
		scoreFun($("#appraisal3"))
		function submitfunction(){
			var one=$("#serve").html();
			var two=$("#speed").html();
			var three=$("#price").html();
			var four=$("#content").val();
			if(a==0||b==0||c==0){
				layer.msg('请对收运人员评价');
			}else{
				var jsonadd = ' [{"one": "'+one+'","two":"'+two+'","three":"'+three+'","four":"'+four+'","mobile":"<%=phone%>"}]';
				$.ajax({
						type: "post",
						datatype: 'json',
						contentType: 'application/json;charset=UTF-8',
						url: 'http://118.178.18.0:8082/alfa-mobile-ws/rest/ordercomment/batchinsertordercomment?mobiletoken=a31c6862fd964efd849ce756a9dd890f',
						data: jsonadd,
						success: function(data) {
							if(data.message=="1"){
								layer.msg('添加成功');
							}else{
								
							}
						}
				})
			}
		}
	function GetSingleOpenIdForMobile(mobile) {
		var json = '{"mobile": "'+mobile+'"}';
		$.ajax({
				type: "post",
				datatype: 'json',
				contentType: 'application/json;charset=UTF-8',
				url: 'http://118.178.18.0:8082/alfa-mobile-ws/rest/OpenId/GetSingleOpenIdForMobile?mobiletoken='+getCookie("mobiletokenuser")+'',
				data: json,
				success: function(data) {
					if(data.message=="1"){
						$("#realname").html(data.data.rows.realname);
						$("#num").html(data.data.total);
						$("#hearderimg").attr('src',data.data.rows.headimgurl);
						/* $("#realname").html(data.data.rows.realname); */
					}else{
						
					}
				}
		})
	}
	</script>

</html>